<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:68:"D:\phpStudy\WWW\biye\public/../application/api\view\index\index.html";i:1594398632;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>派逊校服</title>
    <link rel="stylesheet" type="text/css" href="/static/admin/css/api.css"/>
    <link rel="stylesheet" type="text/css" href="/static/admin/css/aui.css"/>
</head>
<body>
<form action="http://by.heikeit.com/api/Home/makeUserPhoto" enctype="multipart/form-data" method="post">
    <input type="file" name="file" />
    <input type="submit" />
</form>
</body>

</html>
<script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
<script type="text/javascript">
    function gopay() {
        var id = $('input[name="ididid"]').val();
        var school = $('input[name="school"]').val();
        var grade = $('input[name="grade"]').val();
        var classclass = $('input[name="class"]').val();
        var name = $('input[name="name"]').val();
        var sex = $('input[name="sex"]:checked').val();
        var idcard = $('input[name="idcard"]').val();
        var type = $('input[name="type"]').val();
        var usetype = $('input[name="usetype"]').val();//码的类型
        var param = 'school='+school+'&grade='+grade+'&class='+classclass+'&name='+name+'&sex='+sex+'&idcard='+idcard+'&type='+type+'&id='+id;
        if(usetype >= 2){
            var money = parseFloat($('input[name="money"]').val());
            money = money.toFixed(2);
            if(money <= 0 || money == '' || money == 'NaN'){
                alert('请填写正确的金额');
                return false;
            }
            param = param +'&money='+money;
        }

        if(usetype != 2){
            var height = $('input[name="height"]').val();
            var weight = $('input[name="weight"]').val();
            var size = $('input[name="size"]').val();
            var sw_j = $('input[name="sw_j"]').val();
            var sw_x = $('input[name="sw_x"]').val();
            var sw_y = $('input[name="sw_y"]').val();
            var sw_t = $('input[name="sw_t"]').val();
            var sw_b = $('input[name="sw_b"]').val();
            var sw_k = $('input[name="sw_k"]').val();
            var xiguan = $('input[name="xiguan"]').val();
            var phone = $('input[name="phone"]').val();
            if(height=='' || weight=='' || size=='' || xiguan==''){
                alert('有未填项');
                return false;
            }
            if(checkPhone(phone) == false){
                alert('请填写正确的手机号码')
                return false;
            }
            param = param +'&height='+height;
            param = param +'&weight='+weight;
            param = param +'&size='+size;
            param = param +'&sw_j='+sw_j;
            param = param +'&sw_x='+sw_x;
            param = param +'&sw_y='+sw_y;
            param = param +'&sw_t='+sw_t;
            param = param +'&sw_b='+sw_b;
            param = param +'&sw_k='+sw_k;
            param = param +'&xiguan='+xiguan;
            param = param +'&phone='+phone;
        }
        if(school=='' || grade=='' || name=='' || idcard==''){
            alert('有未填项');
            return false;
        }else{
            var url = '<?php echo url("Index/buy"); ?>';
            if(usetype == 1){
                url = '<?php echo url("Index/shouji"); ?>';
            }else{
                if(type == 2){
                    url = '<?php echo url("Ali/getParam"); ?>';
                }
            }
            $.ajax({
                url:url,
                data: param, //
                type:'POST',
                dataType:'HTML',
                success: function(returndata){
                    if(usetype == 1){
                        if(returndata == 1){
                            alert('提交成功！');
                            location.reload();
                        }else{
                            alert('提交失败，请刷新重试');
                        }
                    }else{
                        if(returndata == 1){
                            alert('支付失败，请刷新重试');
                        }else if(returndata == 2){
                            alert('订单生成失败，请刷新重试');
                        }else if(returndata == 3){
                            alert('此码已不可用');
                        }else{
                            $('.all_div').css('display','block');
                            $('.all_div').html(returndata);
                        }
                    }
                },
                error:function () {
                    alert('Ajax error!');
                }
            })
        }
    }

    /**
     * 验证手机号
     * */
    function checkPhone(phone) {
        var rule = /^1[23456789]\d{9}$/;
        return rule.test(phone);
    }
    /**
     * 验证手机号
     * */
    /**
     * 验证手机号
     * */
    function checkIdcard(idCard) {
        var rule = /^2[0123456789]\d{3}$/;
        return rule.test(idCard);
    }
    $('#sizeaaa').click(function () {
        $('.all_div2').css('display','block')
        $('html,body').addClass('ovfHiden');
    })
    $('.all_div2').click(function () {
        $('.all_div2').css('display','none')
        $('html,body').removeClass('ovfHiden');
    })
</script>